<?php

require_once './include/common.inc.php';

$page_title = 'jans2en furniture - Inventory - Inventory';
$menu_id = 6;
$page_guide_name = 'Inventory';
$page_guide_pic = 'jf_section_header_inventory.jpg';
checkLogin();

getMyParam('special');

// -------------- guideͼƬ start ----------------------------------------
$system_ary = getSystemValue("");
$guide_pic = $system_ary['picture_inventory'];
$page_special_pic = $system_ary['picture_specials'];

$page_guide_pic = $guide_pic;

setStatus($special);


if (trim($page_guide_pic) == "" || !file_exists("./zh/attachments/system/" . $page_guide_pic)) {
    $guide_pic = './zh/attachments/system/no_guide.gif';
} else {
    $guide_pic = './zh/attachments/system/' . $page_guide_pic;
}
// -------------- guideͼƬ end ------------------------------------------

if ($jansen_type==2) {
	$sql_where = 'WHERE 1=1 ';
} elseif ($jansen_type == 1) {
	$sql_where = ' WHERE n.`type` = 1 ';
} 

//$sql = "SELECT `id`, `name`, `pic`, `type` FROM `inventory` " . $sql_where . " ORDER BY `seq` ASC";
$sql = "SELECT n.`id`, n.`name`, n.`pic`, n.`type` FROM `inventory` as n, `product_inventory` as i " . $sql_where . $sql_2 . $sql_3 . " AND n.id = i.`inventory_id` AND i.`qty` > 0 GROUP BY n.`id` ORDER BY n.`seq` ASC";
//echo $sql;
$query = $db->query($sql);
while($rs = $db->fetch_array($query)) {
	$out_ary[] = $rs;
}
 
if($special == '1'){
	if($out_ary){
		browseTracking(11,0,'Home > Specials'); 
	}else{
		//debug('a');
		
	} 
}else{
	browseTracking(15,0,'Home > Inventory');
}

$postiondiv='<div class="position"><a href="index.php">Home</a> &gt; <span > Inventory Category</span></div>';
$baner_img='<div class="bigtitle">Inventory</div>';

/*
if($special==1)
{
	
	$postiondiv='<div class="position"><a href="index.php">Home</a> &gt; <span class="position"> Specialls</span></div>';
	$baner_img='<div class="bigtitle">Specialls</div>';
		
}
*/
require_once PrintEot('header');
require_once PrintEot('inventory');
require_once PrintEot('footer');

?>